package com.weimob.mcloud.wechatwork.customer.service.user.enums;

import lombok.Getter;

/**
 * 外部联系人流失方式
 * @author yu liu
 * @date 2021/2/24
 * @since v5.2
 */
public enum CustomerLoseTypeEnum {
    INIT(0, "客户和员工还是好友 初始化", "初始化"),
    CUSTOMER_DEL_EMPLOYEE(1, "客户删除员工", "客户删除员工"),
    EMPLOYEE_DEL_CUSTOMER(2, "员工删除客户", "员工删除客户"),
    DOUBLE_DELETE(3, "双向删除-(客户先删除的员工)", "客户删除员工")
    ;

    @Getter
    private Integer code;

    @Getter
    private String desc;

    @Getter
    private String value;

    CustomerLoseTypeEnum(Integer code, String desc ,String value) {
        this.code = code;
        this.desc = desc;
        this.value = value;
    }

    public static CustomerLoseTypeEnum getEnumByCode(Integer code){
        for (CustomerLoseTypeEnum value : CustomerLoseTypeEnum.values()) {
            if(value.getCode().equals(code)){
                return value;
            }
        }
        return null;
    }
}
